#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <malloc.h>
#include <sys/time.h>

#include <ijpege_common.h>

void ijpege_log(ijpege_t *h, int i_level, const char *psz_fmt, ... )
{
    if(!h || i_level <= h->param.i_log_level) {
        va_list arg;
        va_start( arg, psz_fmt );
        if(!h)
            c_log_default("ijpege", i_level, psz_fmt, arg);
        else
            h->param.pf_log(h->param.module, i_level, psz_fmt, arg);
        va_end(arg);
    }
}

void ijpege_param_default(ijpege_param_t *param)
{
	memset(param, 0, sizeof(*param));
	param->soc = C_T10;
	param->b_tlb = 0;
	param->b_use_phy = 1;
	param->b_user_fenc = 1;
	param->i_devid = -1;
	param->i_width = 1280;
	param->i_height = 720;
	param->i_csp = C_CSP_NV12;
	param->pf_log = c_log_default;
	param->module = "ijpege";
	param->i_log_level = C_LOG_INFO;
};
